from django.conf.urls.defaults import *

urlpatterns = patterns('',
  # Admin URLs (should always be active)
  (r'^admin/?$', 'osda.views.admin'),  
  
  # Maintenance URLs (uncomment for maintenance mode)
  # (r'^migrate/(?P<model>\w*)/?$', 'osda.migrations.migrate'),
  # (r'^gadgetapi.*', 'osda.views.maintenance_json'),
  # (r'^.*', 'osda.views.maintenance'),
  
  # Deployment URLs
  (r'^/?$', 'osda.views.index'),
  (r'^help/(?P<help_page>\w*)/?$', 'osda.views.help'),  
  (r'^news/?$', 'osda.blogs.list'),
  (r'^tools/?$', 'osda.views.tools'),
  (r'^code/sample/(?P<code_id>\w*)/?$', 'osda.views.show_code'),  
  (r'^clipboard/?$', 'osda.views.clipboard'),
  
  # API endpoints
  (r'^gadgetapi/cansave/?$', 'osda.views.api_can_save'),
  (r'^gadgetapi/samples/?$', 'osda.views.api_list_owner_samples'),
  (r'^gadgetapi/xmlspecs/?$', 'osda.views.api_list_owner_xmlspecs'),
  (r'^gadgetapi/sample/(?P<record_id>\w*)/?$', 'osda.views.api_get_record'),
  (r'^gadgetapi/xmlspec/(?P<record_id>\w*)/?$', 'osda.views.api_get_record'),
  (r'^gadgetapi/globalsamples/?$', 'osda.views.api_list_samples'),
  (r'^gadgetapi/savesample/?$', 'osda.views.api_save_sample'),
  (r'^gadgetapi/savexmlspec/?$', 'osda.views.api_save_xmlspec'),
  (r'^gadgetapi/deleterecord/(?P<record_id>\w*)/?$', 'osda.views.api_delete_record'),
  (r'^gadgetapi/clearcache/?$', 'osda.views.api_clear_cache'),
)
